-- public.huiyuan_age definition

-- Drop table

-- DROP TABLE public.huiyuan_age;

CREATE TABLE public.huiyuan_age (
                                    id varchar(36) NULL,
                                    "name" varchar(50) NULL,
                                    value varchar(20) NULL
);

-- Permissions

ALTER TABLE public.huiyuan_age OWNER TO ruoyi;
GRANT ALL ON TABLE public.huiyuan_age TO ruoyi;


-- public.huiyuan_fengongsi definition

-- Drop table

-- DROP TABLE public.huiyuan_fengongsi;

CREATE TABLE public.huiyuan_fengongsi (
                                          id varchar(36) NULL,
                                          "name" varchar(50) NULL,
                                          value varchar(20) NULL,
                                          "type" varchar(32) NULL
);

-- Permissions

ALTER TABLE public.huiyuan_fengongsi OWNER TO ruoyi;
GRANT ALL ON TABLE public.huiyuan_fengongsi TO ruoyi;


-- public.huiyuan_huoyuedu definition

-- Drop table

-- DROP TABLE public.huiyuan_huoyuedu;

CREATE TABLE public.huiyuan_huoyuedu (
                                         id varchar(36) NULL,
                                         "name" varchar(50) NULL,
                                         value varchar(20) NULL
);

-- Permissions

ALTER TABLE public.huiyuan_huoyuedu OWNER TO ruoyi;
GRANT ALL ON TABLE public.huiyuan_huoyuedu TO ruoyi;


-- public.huiyuan_sex definition

-- Drop table

-- DROP TABLE public.huiyuan_sex;

CREATE TABLE public.huiyuan_sex (
                                    id varchar(36) NULL,
                                    "name" varchar(50) NULL,
                                    value varchar(20) NULL
);

-- Permissions

ALTER TABLE public.huiyuan_sex OWNER TO ruoyi;
GRANT ALL ON TABLE public.huiyuan_sex TO ruoyi;


-- public.huiyuan_work definition

-- Drop table

-- DROP TABLE public.huiyuan_work;

CREATE TABLE public.huiyuan_work (
                                     id varchar(36) NULL,
                                     "name" varchar(50) NULL,
                                     value varchar(20) NULL
);

-- Permissions

ALTER TABLE public.huiyuan_work OWNER TO ruoyi;
GRANT ALL ON TABLE public.huiyuan_work TO ruoyi;


-- public.huiyuan_wxtl definition

-- Drop table

-- DROP TABLE public.huiyuan_wxtl;

CREATE TABLE public.huiyuan_wxtl (
                                     id varchar(36) NULL,
                                     "name" varchar(50) NULL,
                                     value varchar(20) NULL
);

-- Permissions

ALTER TABLE public.huiyuan_wxtl OWNER TO ruoyi;
GRANT ALL ON TABLE public.huiyuan_wxtl TO ruoyi;


-- public.huiyuan_wxtlshuliang definition

-- Drop table

-- DROP TABLE public.huiyuan_wxtlshuliang;

CREATE TABLE public.huiyuan_wxtlshuliang (
                                             id varchar(36) NULL,
                                             "name" varchar(50) NULL,
                                             value int4 NULL
);

-- Permissions

ALTER TABLE public.huiyuan_wxtlshuliang OWNER TO ruoyi;
GRANT ALL ON TABLE public.huiyuan_wxtlshuliang TO ruoyi;


-- public.huiyuan_xueli definition

-- Drop table

-- DROP TABLE public.huiyuan_xueli;

CREATE TABLE public.huiyuan_xueli (
                                      id varchar(36) NULL,
                                      "name" varchar(50) NULL,
                                      value varchar(20) NULL
);

-- Permissions

ALTER TABLE public.huiyuan_xueli OWNER TO ruoyi;
GRANT ALL ON TABLE public.huiyuan_xueli TO ruoyi;


-- public.jimu_dict definition

-- Drop table

-- DROP TABLE public.jimu_dict;

CREATE TABLE public.jimu_dict (
                                  id varchar(32) NULL,
                                  dict_name varchar(100) NULL,
                                  dict_code varchar(100) NULL,
                                  description varchar(255) NULL,
                                  del_flag int4 NULL,
                                  create_by varchar(32) NULL,
                                  create_time timestamp NULL,
                                  update_by varchar(32) NULL,
                                  update_time timestamp NULL,
                                  "type" int4 NULL,
                                  tenant_id varchar(10) NULL
);

-- Permissions

ALTER TABLE public.jimu_dict OWNER TO ruoyi;
GRANT ALL ON TABLE public.jimu_dict TO ruoyi;


-- public.jimu_dict_item definition

-- Drop table

-- DROP TABLE public.jimu_dict_item;

CREATE TABLE public.jimu_dict_item (
                                       id varchar(32) NULL,
                                       dict_id varchar(32) NULL,
                                       item_text varchar(100) NULL,
                                       item_value varchar(100) NULL,
                                       description varchar(255) NULL,
                                       sort_order int4 NULL,
                                       status int4 NULL,
                                       create_by varchar(32) NULL,
                                       create_time timestamp NULL,
                                       update_by varchar(32) NULL,
                                       update_time timestamp NULL
);

-- Permissions

ALTER TABLE public.jimu_dict_item OWNER TO ruoyi;
GRANT ALL ON TABLE public.jimu_dict_item TO ruoyi;


-- public.jimu_report definition

-- Drop table

-- DROP TABLE public.jimu_report;

CREATE TABLE public.jimu_report (
                                    id varchar(32) NULL,
                                    code varchar(50) NULL,
                                    "name" varchar(50) NULL,
                                    note varchar(255) NULL,
                                    status varchar(10) NULL,
                                    "type" varchar(50) NULL,
                                    json_str text NULL,
                                    api_url varchar(255) NULL,
                                    thumb text NULL,
                                    create_by varchar(50) NULL,
                                    create_time timestamp NULL,
                                    update_by varchar(50) NULL,
                                    update_time timestamp NULL,
                                    del_flag int4 NULL,
                                    api_method varchar(255) NULL,
                                    api_code varchar(255) NULL,
                                    "template" int4 NULL,
                                    view_count int8 NULL,
                                    css_str text NULL,
                                    js_str text NULL,
                                    py_str text NULL,
                                    tenant_id varchar(10) NULL,
                                    update_count int4 NULL,
                                    submit_form int4 NULL
);

-- Permissions

ALTER TABLE public.jimu_report OWNER TO ruoyi;
GRANT ALL ON TABLE public.jimu_report TO ruoyi;


-- public.jimu_report_category definition

-- Drop table

-- DROP TABLE public.jimu_report_category;

CREATE TABLE public.jimu_report_category (
                                             id varchar(32) NULL,
                                             "name" varchar(100) NULL,
                                             parent_id varchar(32) NULL,
                                             iz_leaf int4 NULL,
                                             source_type varchar(10) NULL,
                                             create_by varchar(32) NULL,
                                             create_time timestamp NULL,
                                             update_by varchar(32) NULL,
                                             update_time timestamp NULL,
                                             tenant_id varchar(11) NULL,
                                             del_flag int4 NULL,
                                             sort_no int4 NULL
);

-- Permissions

ALTER TABLE public.jimu_report_category OWNER TO ruoyi;
GRANT ALL ON TABLE public.jimu_report_category TO ruoyi;


-- public.jimu_report_data_source definition

-- Drop table

-- DROP TABLE public.jimu_report_data_source;

CREATE TABLE public.jimu_report_data_source (
                                                id varchar(36) NULL,
                                                "name" varchar(100) NULL,
                                                report_id varchar(100) NULL,
                                                code varchar(100) NULL,
                                                remark varchar(200) NULL,
                                                db_type varchar(10) NULL,
                                                db_driver varchar(100) NULL,
                                                db_url varchar(500) NULL,
                                                db_username varchar(100) NULL,
                                                db_password varchar(100) NULL,
                                                create_by varchar(50) NULL,
                                                create_time timestamp NULL,
                                                update_by varchar(50) NULL,
                                                update_time timestamp NULL,
                                                connect_times int4 NULL,
                                                tenant_id varchar(10) NULL,
                                                "type" varchar(10) NULL
);

-- Permissions

ALTER TABLE public.jimu_report_data_source OWNER TO ruoyi;
GRANT ALL ON TABLE public.jimu_report_data_source TO ruoyi;


-- public.jimu_report_db definition

-- Drop table

-- DROP TABLE public.jimu_report_db;

CREATE TABLE public.jimu_report_db (
                                       id varchar(36) NULL,
                                       jimu_report_id varchar(32) NULL,
                                       create_by varchar(50) NULL,
                                       update_by varchar(50) NULL,
                                       create_time timestamp NULL,
                                       update_time timestamp NULL,
                                       db_code varchar(32) NULL,
                                       db_ch_name varchar(50) NULL,
                                       db_type varchar(32) NULL,
                                       db_table_name varchar(32) NULL,
                                       db_dyn_sql text NULL,
                                       db_key varchar(32) NULL,
                                       tb_db_key varchar(32) NULL,
                                       tb_db_table_name varchar(32) NULL,
                                       java_type varchar(32) NULL,
                                       java_value varchar(255) NULL,
                                       api_url varchar(255) NULL,
                                       api_method varchar(255) NULL,
                                       is_list varchar(10) NULL,
                                       is_page varchar(10) NULL,
                                       db_source varchar(255) NULL,
                                       db_source_type varchar(50) NULL,
                                       json_data text NULL,
                                       api_convert varchar(255) NULL,
                                       iz_shared_source int4 NULL,
                                       jimu_shared_source_id varchar(32) NULL
);

-- Permissions

ALTER TABLE public.jimu_report_db OWNER TO ruoyi;
GRANT ALL ON TABLE public.jimu_report_db TO ruoyi;


-- public.jimu_report_db_field definition

-- Drop table

-- DROP TABLE public.jimu_report_db_field;

CREATE TABLE public.jimu_report_db_field (
                                             id varchar(36) NULL,
                                             create_by varchar(50) NULL,
                                             create_time timestamp NULL,
                                             update_by varchar(50) NULL,
                                             update_time timestamp NULL,
                                             jimu_report_db_id varchar(32) NULL,
                                             field_name varchar(80) NULL,
                                             field_name_physics varchar(200) NULL,
                                             field_text varchar(50) NULL,
                                             widget_type varchar(50) NULL,
                                             widget_width int4 NULL,
                                             order_num int4 NULL,
                                             search_flag int4 NULL,
                                             search_mode int4 NULL,
                                             dict_code varchar(255) NULL,
                                             search_value varchar(100) NULL,
                                             search_format varchar(50) NULL,
                                             ext_json text NULL
);

-- Permissions

ALTER TABLE public.jimu_report_db_field OWNER TO ruoyi;
GRANT ALL ON TABLE public.jimu_report_db_field TO ruoyi;


-- public.jimu_report_db_param definition

-- Drop table

-- DROP TABLE public.jimu_report_db_param;

CREATE TABLE public.jimu_report_db_param (
                                             id varchar(36) NULL,
                                             jimu_report_head_id varchar(36) NULL,
                                             param_name varchar(32) NULL,
                                             param_txt varchar(32) NULL,
                                             param_value varchar(1000) NULL,
                                             order_num int4 NULL,
                                             create_by varchar(50) NULL,
                                             create_time timestamp NULL,
                                             update_by varchar(50) NULL,
                                             update_time timestamp NULL,
                                             search_flag int4 NULL,
                                             widget_type varchar(50) NULL,
                                             search_mode int4 NULL,
                                             dict_code varchar(255) NULL,
                                             search_format varchar(50) NULL,
                                             ext_json text NULL
);

-- Permissions

ALTER TABLE public.jimu_report_db_param OWNER TO ruoyi;
GRANT ALL ON TABLE public.jimu_report_db_param TO ruoyi;


-- public.jimu_report_export_job definition

-- Drop table

-- DROP TABLE public.jimu_report_export_job;

CREATE TABLE public.jimu_report_export_job (
                                               id varchar(32) NULL,
                                               "name" varchar(100) NULL,
                                               begin_time timestamp NULL,
                                               end_time timestamp NULL,
                                               exec_interval varchar(100) NULL,
                                               report_conf text NULL,
                                               last_run_time timestamp NULL,
                                               receiver_email text NULL,
                                               file_sync_path varchar(255) NULL,
                                               status int4 NULL,
                                               create_by varchar(50) NULL,
                                               create_time timestamp NULL,
                                               update_by varchar(50) NULL,
                                               update_time timestamp NULL,
                                               tenant_id varchar(10) NULL
);

-- Permissions

ALTER TABLE public.jimu_report_export_job OWNER TO ruoyi;
GRANT ALL ON TABLE public.jimu_report_export_job TO ruoyi;


-- public.jimu_report_export_log definition

-- Drop table

-- DROP TABLE public.jimu_report_export_log;

CREATE TABLE public.jimu_report_export_log (
                                               id varchar(32) NULL,
                                               batch_no varchar(50) NULL,
                                               export_channel varchar(20) NULL,
                                               export_from varchar(20) NULL,
                                               from_id varchar(32) NULL,
                                               export_type varchar(10) NULL,
                                               report_id text NULL,
                                               download_path varchar(255) NULL,
                                               status varchar(15) NULL,
                                               err_msg text NULL,
                                               create_by varchar(32) NULL,
                                               create_time timestamp NULL,
                                               update_time timestamp NULL,
                                               tenant_id varchar(10) NULL
);

-- Permissions

ALTER TABLE public.jimu_report_export_log OWNER TO ruoyi;
GRANT ALL ON TABLE public.jimu_report_export_log TO ruoyi;


-- public.jimu_report_icon_lib definition

-- Drop table

-- DROP TABLE public.jimu_report_icon_lib;

CREATE TABLE public.jimu_report_icon_lib (
                                             id varchar(32) NULL,
                                             "name" varchar(100) NULL,
                                             "type" varchar(32) NULL,
                                             image_url varchar(255) NULL,
                                             create_by varchar(32) NULL,
                                             create_time timestamp NULL,
                                             update_by varchar(32) NULL,
                                             update_time timestamp NULL,
                                             tenant_id int4 NULL
);

-- Permissions

ALTER TABLE public.jimu_report_icon_lib OWNER TO ruoyi;
GRANT ALL ON TABLE public.jimu_report_icon_lib TO ruoyi;


-- public.jimu_report_link definition

-- Drop table

-- DROP TABLE public.jimu_report_link;

CREATE TABLE public.jimu_report_link (
                                         id varchar(32) NULL,
                                         report_id varchar(32) NULL,
                                         "parameter" text NULL,
                                         eject_type varchar(1) NULL,
                                         link_name varchar(255) NULL,
                                         api_method varchar(1) NULL,
                                         link_type varchar(1) NULL,
                                         api_url varchar(1000) NULL,
                                         link_chart_id varchar(50) NULL,
                                         "expression" varchar(255) NULL,
                                         requirement varchar(255) NULL
);

-- Permissions

ALTER TABLE public.jimu_report_link OWNER TO ruoyi;
GRANT ALL ON TABLE public.jimu_report_link TO ruoyi;


-- public.jimu_report_map definition

-- Drop table

-- DROP TABLE public.jimu_report_map;

CREATE TABLE public.jimu_report_map (
                                        id varchar(64) NULL,
                                        "label" varchar(125) NULL,
                                        "name" varchar(125) NULL,
                                        "data" text NULL,
                                        create_by varchar(32) NULL,
                                        create_time timestamp NULL,
                                        update_by varchar(32) NULL,
                                        update_time timestamp NULL,
                                        del_flag varchar(1) NULL,
                                        sys_org_code varchar(64) NULL
);

-- Permissions

ALTER TABLE public.jimu_report_map OWNER TO ruoyi;
GRANT ALL ON TABLE public.jimu_report_map TO ruoyi;


-- public.jimu_report_share definition

-- Drop table

-- DROP TABLE public.jimu_report_share;

CREATE TABLE public.jimu_report_share (
                                          id varchar(32) NULL,
                                          report_id varchar(32) NULL,
                                          preview_url varchar(1000) NULL,
                                          preview_lock varchar(4) NULL,
                                          last_update_time timestamp NULL,
                                          term_of_validity varchar(1) NULL,
                                          status varchar(1) NULL,
                                          preview_lock_status varchar(1) NULL,
                                          share_token varchar(50) NULL
);

-- Permissions

ALTER TABLE public.jimu_report_share OWNER TO ruoyi;
GRANT ALL ON TABLE public.jimu_report_share TO ruoyi;


-- public.onl_drag_comp definition

-- Drop table

-- DROP TABLE public.onl_drag_comp;

CREATE TABLE public.onl_drag_comp (
                                      id varchar(32) NULL,
                                      parent_id varchar(32) NULL,
                                      comp_name varchar(50) NULL,
                                      comp_type varchar(20) NULL,
                                      icon varchar(50) NULL,
                                      order_num int4 NULL,
                                      type_id int4 NULL,
                                      comp_config text NULL,
                                      status varchar(2) NULL,
                                      create_by varchar(50) NULL,
                                      create_time timestamp NULL,
                                      update_by varchar(50) NULL,
                                      update_time timestamp NULL
);

-- Permissions

ALTER TABLE public.onl_drag_comp OWNER TO ruoyi;
GRANT ALL ON TABLE public.onl_drag_comp TO ruoyi;


-- public.onl_drag_dataset_head definition

-- Drop table

-- DROP TABLE public.onl_drag_dataset_head;

CREATE TABLE public.onl_drag_dataset_head (
                                              id varchar(32) NULL,
                                              "name" varchar(100) NULL,
                                              code varchar(36) NULL,
                                              parent_id varchar(36) NULL,
                                              db_source varchar(100) NULL,
                                              query_sql varchar(5000) NULL,
                                              "content" varchar(1000) NULL,
                                              iz_agent varchar(10) NULL,
                                              data_type varchar(50) NULL,
                                              api_method varchar(10) NULL,
                                              create_time timestamp NULL,
                                              create_by varchar(50) NULL,
                                              update_time timestamp NULL,
                                              update_by varchar(50) NULL,
                                              low_app_id varchar(32) NULL,
                                              tenant_id int4 NULL
);

-- Permissions

ALTER TABLE public.onl_drag_dataset_head OWNER TO ruoyi;
GRANT ALL ON TABLE public.onl_drag_dataset_head TO ruoyi;


-- public.onl_drag_dataset_item definition

-- Drop table

-- DROP TABLE public.onl_drag_dataset_item;

CREATE TABLE public.onl_drag_dataset_item (
                                              id varchar(32) NULL,
                                              head_id varchar(36) NULL,
                                              field_name varchar(36) NULL,
                                              field_txt varchar(1000) NULL,
                                              field_type varchar(10) NULL,
                                              widget_type varchar(30) NULL,
                                              dict_code varchar(500) NULL,
                                              dict_table varchar(125) NULL,
                                              dict_text varchar(125) NULL,
                                              iz_show varchar(5) NULL,
                                              iz_search varchar(10) NULL,
                                              iz_total varchar(5) NULL,
                                              search_mode varchar(10) NULL,
                                              order_num int4 NULL,
                                              create_by varchar(32) NULL,
                                              create_time timestamp NULL,
                                              update_by varchar(32) NULL,
                                              update_time timestamp NULL
);

-- Permissions

ALTER TABLE public.onl_drag_dataset_item OWNER TO ruoyi;
GRANT ALL ON TABLE public.onl_drag_dataset_item TO ruoyi;


-- public.onl_drag_dataset_param definition

-- Drop table

-- DROP TABLE public.onl_drag_dataset_param;

CREATE TABLE public.onl_drag_dataset_param (
                                               id varchar(36) NULL,
                                               head_id varchar(36) NULL,
                                               param_name varchar(32) NULL,
                                               param_txt varchar(32) NULL,
                                               param_value varchar(1000) NULL,
                                               order_num int4 NULL,
                                               iz_search int4 NULL,
                                               widget_type varchar(50) NULL,
                                               search_mode int4 NULL,
                                               dict_code varchar(255) NULL,
                                               create_by varchar(50) NULL,
                                               create_time timestamp NULL,
                                               update_by varchar(50) NULL,
                                               update_time timestamp NULL
);

-- Permissions

ALTER TABLE public.onl_drag_dataset_param OWNER TO ruoyi;
GRANT ALL ON TABLE public.onl_drag_dataset_param TO ruoyi;


-- public.onl_drag_page definition

-- Drop table

-- DROP TABLE public.onl_drag_page;

CREATE TABLE public.onl_drag_page (
                                      id varchar(50) NULL,
                                      "name" varchar(100) NULL,
                                      "path" varchar(100) NULL,
                                      background_color varchar(10) NULL,
                                      background_image varchar(255) NULL,
                                      design_type int4 NULL,
                                      theme varchar(10) NULL,
                                      "style" varchar(20) NULL,
                                      cover_url varchar(500) NULL,
                                      des_json varchar(500) NULL,
                                      "template" text NULL,
                                      protection_code varchar(32) NULL,
                                      "type" varchar(64) NULL,
                                      iz_template varchar(10) NULL,
                                      create_by varchar(50) NULL,
                                      create_time timestamp NULL,
                                      update_by varchar(50) NULL,
                                      update_time timestamp NULL,
                                      low_app_id varchar(50) NULL,
                                      tenant_id int4 NULL,
                                      update_count int4 NULL,
                                      visits_num int4 NULL,
                                      del_flag int4 NULL
);

-- Permissions

ALTER TABLE public.onl_drag_page OWNER TO ruoyi;
GRANT ALL ON TABLE public.onl_drag_page TO ruoyi;


-- public.onl_drag_page_comp definition

-- Drop table

-- DROP TABLE public.onl_drag_page_comp;

CREATE TABLE public.onl_drag_page_comp (
                                           id varchar(32) NULL,
                                           parent_id varchar(32) NULL,
                                           page_id varchar(50) NULL,
                                           comp_id varchar(32) NULL,
                                           component varchar(50) NULL,
                                           config text NULL,
                                           create_by varchar(50) NULL,
                                           create_time timestamp NULL,
                                           update_by varchar(50) NULL,
                                           update_time timestamp NULL
);

-- Permissions

ALTER TABLE public.onl_drag_page_comp OWNER TO ruoyi;
GRANT ALL ON TABLE public.onl_drag_page_comp TO ruoyi;


-- public.onl_drag_share definition

-- Drop table

-- DROP TABLE public.onl_drag_share;

CREATE TABLE public.onl_drag_share (
                                       id varchar(32) NULL,
                                       drag_id varchar(32) NULL,
                                       preview_url varchar(1000) NULL,
                                       preview_lock varchar(4) NULL,
                                       last_update_time timestamp NULL,
                                       term_of_validity varchar(1) NULL,
                                       status varchar(1) NULL,
                                       preview_lock_status varchar(1) NULL,
                                       share_token varchar(32) NULL
);

-- Permissions

ALTER TABLE public.onl_drag_share OWNER TO ruoyi;
GRANT ALL ON TABLE public.onl_drag_share TO ruoyi;


-- public.onl_drag_table_relation definition

-- Drop table

-- DROP TABLE public.onl_drag_table_relation;

CREATE TABLE public.onl_drag_table_relation (
                                                id varchar(50) NULL,
                                                aggregation_name varchar(100) NULL,
                                                aggregation_desc varchar(100) NULL,
                                                relation_forms text NULL,
                                                filter_condition text NULL,
                                                header_fields text NULL,
                                                calculate_fields text NULL,
                                                validate_info text NULL,
                                                del_flag int4 NULL,
                                                low_app_id varchar(50) NULL,
                                                tenant_id int4 NULL,
                                                create_by varchar(50) NULL,
                                                create_time timestamp NULL,
                                                update_by varchar(50) NULL,
                                                update_time timestamp NULL
);

-- Permissions

ALTER TABLE public.onl_drag_table_relation OWNER TO ruoyi;
GRANT ALL ON TABLE public.onl_drag_table_relation TO ruoyi;


-- public.rep_demo_dxtj definition

-- Drop table

-- DROP TABLE public.rep_demo_dxtj;

CREATE TABLE public.rep_demo_dxtj (
                                      id varchar(36) NULL,
                                      "name" varchar(50) NULL,
                                      gtime timestamp NULL,
                                      update_by varchar(50) NULL,
                                      jphone varchar(125) NULL,
                                      birth timestamp NULL,
                                      hukou varchar(32) NULL,
                                      laddress varchar(125) NULL,
                                      jperson varchar(32) NULL,
                                      sex varchar(32) NULL
);

-- Permissions

ALTER TABLE public.rep_demo_dxtj OWNER TO ruoyi;
GRANT ALL ON TABLE public.rep_demo_dxtj TO ruoyi;


-- public.rep_demo_employee definition

-- Drop table

-- DROP TABLE public.rep_demo_employee;

CREATE TABLE public.rep_demo_employee (
                                          id varchar(10) NULL,
                                          num varchar(50) NULL,
                                          "name" varchar(100) NULL,
                                          sex varchar(10) NULL,
                                          birthday timestamp NULL,
                                          nation varchar(30) NULL,
                                          political varchar(30) NULL,
                                          native_place varchar(30) NULL,
                                          height varchar(30) NULL,
                                          weight varchar(30) NULL,
                                          health varchar(30) NULL,
                                          id_card varchar(80) NULL,
                                          education varchar(30) NULL,
                                          school varchar(80) NULL,
                                          major varchar(80) NULL,
                                          address varchar(100) NULL,
                                          zip_code varchar(30) NULL,
                                          email varchar(30) NULL,
                                          phone varchar(30) NULL,
                                          foreign_language varchar(30) NULL,
                                          foreign_language_level varchar(30) NULL,
                                          computer_level varchar(30) NULL,
                                          graduation_time timestamp NULL,
                                          arrival_time timestamp NULL,
                                          positional_titles varchar(30) NULL,
                                          education_experience text NULL,
                                          work_experience text NULL,
                                          create_by varchar(32) NULL,
                                          create_time timestamp NULL,
                                          update_by varchar(32) NULL,
                                          update_time timestamp NULL,
                                          del_flag int4 NULL
);

-- Permissions

ALTER TABLE public.rep_demo_employee OWNER TO ruoyi;
GRANT ALL ON TABLE public.rep_demo_employee TO ruoyi;


-- public.rep_demo_gongsi definition

-- Drop table

-- DROP TABLE public.rep_demo_gongsi;

CREATE TABLE public.rep_demo_gongsi (
                                        id int4 NOT NULL,
                                        gname varchar(125) NULL,
                                        gdata varchar(255) NULL,
                                        tdata varchar(125) NULL,
                                        didian varchar(255) NULL,
                                        zhaiyao varchar(255) NULL,
                                        num varchar(255) NULL
);

-- Permissions

ALTER TABLE public.rep_demo_gongsi OWNER TO ruoyi;
GRANT ALL ON TABLE public.rep_demo_gongsi TO ruoyi;


-- public.rep_demo_jianpiao definition

-- Drop table

-- DROP TABLE public.rep_demo_jianpiao;

CREATE TABLE public.rep_demo_jianpiao (
                                          id int4 NOT NULL,
                                          bnum varchar(125) NULL,
                                          ftime varchar(125) NULL,
                                          sfkong varchar(125) NULL,
                                          kaishi varchar(125) NULL,
                                          jieshu varchar(125) NULL,
                                          hezairen varchar(125) NULL,
                                          jpnum varchar(125) NULL,
                                          shihelv varchar(125) NULL,
                                          s_id int4 NOT NULL
);

-- Permissions

ALTER TABLE public.rep_demo_jianpiao OWNER TO ruoyi;
GRANT ALL ON TABLE public.rep_demo_jianpiao TO ruoyi;


-- public.rep_demo_xiaoshou definition

-- Drop table

-- DROP TABLE public.rep_demo_xiaoshou;

CREATE TABLE public.rep_demo_xiaoshou (
                                          id int4 NOT NULL,
                                          hnum varchar(125) NULL,
                                          hname varchar(125) NULL,
                                          xinghao varchar(125) NULL,
                                          fahuocangku varchar(125) NULL,
                                          danwei varchar(125) NULL,
                                          num int4 NOT NULL,
                                          danjia varchar(125) NULL,
                                          zhekoulv int4 NOT NULL,
                                          xiaoshoujine varchar(125) NULL,
                                          beizhu varchar(125) NULL,
                                          s_id varchar(11) NULL
);

-- Permissions

ALTER TABLE public.rep_demo_xiaoshou OWNER TO ruoyi;
GRANT ALL ON TABLE public.rep_demo_xiaoshou TO ruoyi;


-- public.test_customer definition

-- Drop table

-- DROP TABLE public.test_customer;

CREATE TABLE public.test_customer (
                                      id int4 NOT NULL,
                                      code varchar(50) NULL,
                                      "name" varchar(50) NULL,
                                      address varchar(100) NULL,
                                      yylx varchar(2) NULL,
                                      zyyw varchar(255) NULL,
                                      clsj date NULL,
                                      fzr varchar(50) NULL,
                                      phone varchar(11) NULL,
                                      khyj varchar(255) NULL,
                                      xypd varchar(255) NULL,
                                      tbr varchar(50) NULL,
                                      depts varchar(50) NULL
);

-- Permissions

ALTER TABLE public.test_customer OWNER TO ruoyi;
GRANT ALL ON TABLE public.test_customer TO ruoyi;


-- public.test_order definition

-- Drop table

-- DROP TABLE public.test_order;

CREATE TABLE public.test_order (
                                   id varchar(32) NULL,
                                   order_name varchar(50) NULL,
                                   order_no varchar(50) NULL,
                                   order_sign_date timestamp NULL,
                                   order_delivery_date timestamp NULL,
                                   order_coms varchar(50) NULL,
                                   order_pers varchar(50) NULL,
                                   order_phone varchar(15) NULL,
                                   fzr varchar(50) NULL,
                                   depts varchar(50) NULL
);

-- Permissions

ALTER TABLE public.test_order OWNER TO ruoyi;
GRANT ALL ON TABLE public.test_order TO ruoyi;


-- public.test_order_pros definition

-- Drop table

-- DROP TABLE public.test_order_pros;

CREATE TABLE public.test_order_pros (
                                        id varchar(32) NULL,
                                        pro_name varchar(50) NULL,
                                        pro_no varchar(50) NULL,
                                        pro_count varchar(11) NULL,
                                        pro_price numeric(10, 2) NULL,
                                        pro_unit varchar(10) NULL,
                                        pro_model varchar(10) NULL,
                                        main_id varchar(32) NULL
);

-- Permissions

ALTER TABLE public.test_order_pros OWNER TO ruoyi;
GRANT ALL ON TABLE public.test_order_pros TO ruoyi;


-- public.test_resume definition

-- Drop table

-- DROP TABLE public.test_resume;

CREATE TABLE public.test_resume (
                                    id int4 NOT NULL,
                                    "name" varchar(50) NULL,
                                    sex varchar(2) NULL,
                                    birthday date NULL,
                                    phone varchar(11) NULL,
                                    email varchar(50) NULL,
                                    address varchar(255) NULL,
                                    native_place varchar(200) NULL,
                                    nation varchar(100) NULL,
                                    political_outlook varchar(50) NULL,
                                    education varchar(10) NULL,
                                    graduation_school varchar(50) NULL,
                                    self_evaluation varchar(255) NULL,
                                    salary_expectation numeric(10, 2) NULL,
                                    edu_experience varchar(255) NULL,
                                    work_experience varchar(255) NULL
);

-- Permissions

ALTER TABLE public.test_resume OWNER TO ruoyi;
GRANT ALL ON TABLE public.test_resume TO ruoyi;


-- public.test_test definition

-- Drop table

-- DROP TABLE public.test_test;

CREATE TABLE public.test_test (
                                  test_id bigserial NOT NULL,
                                  test_name varchar NULL,
                                  test_code varchar NULL,
                                  create_by varchar(64) NULL DEFAULT ''::character varying, -- 创建者
                                  create_time timestamp NULL, -- 创建时间
                                  update_by varchar(64) NULL DEFAULT ''::character varying, -- 更新者
                                  update_time timestamp NULL, -- 更新时间
                                  remark varchar(500) NULL DEFAULT ''::character varying, -- 备注
                                  CONSTRAINT test_test_pk PRIMARY KEY (test_id)
);
COMMENT ON TABLE public.test_test IS '测试代码自动生成';

-- Column comments

COMMENT ON COLUMN public.test_test.create_by IS '创建者';
COMMENT ON COLUMN public.test_test.create_time IS '创建时间';
COMMENT ON COLUMN public.test_test.update_by IS '更新者';
COMMENT ON COLUMN public.test_test.update_time IS '更新时间';
COMMENT ON COLUMN public.test_test.remark IS '备注';

-- Permissions

ALTER TABLE public.test_test OWNER TO ruoyi;
GRANT ALL ON TABLE public.test_test TO ruoyi;


-- public.tmp_report_data_1 definition

-- Drop table

-- DROP TABLE public.tmp_report_data_1;

CREATE TABLE public.tmp_report_data_1 (
                                          monty varchar(255) NULL,
                                          main_income numeric(10, 2) NULL,
                                          total numeric(10, 2) NULL,
                                          his_lowest numeric(10, 2) NULL,
                                          his_average numeric(10, 2) NULL,
                                          his_highest numeric(10, 2) NULL
);

-- Permissions

ALTER TABLE public.tmp_report_data_1 OWNER TO ruoyi;
GRANT ALL ON TABLE public.tmp_report_data_1 TO ruoyi;


-- public.tmp_report_data_income definition

-- Drop table

-- DROP TABLE public.tmp_report_data_income;

CREATE TABLE public.tmp_report_data_income (
                                               biz_income varchar(100) NULL,
                                               bx_jj_yongjin numeric(10, 2) NULL,
                                               bx_zx_money numeric(10, 2) NULL,
                                               chengbao_gz_money numeric(10, 2) NULL,
                                               bx_gg_moeny numeric(10, 2) NULL,
                                               tb_zx_money numeric(10, 2) NULL,
                                               neikong_zx_money numeric(10, 2) NULL,
                                               total numeric(10, 2) NULL
);

-- Permissions

ALTER TABLE public.tmp_report_data_income OWNER TO ruoyi;
GRANT ALL ON TABLE public.tmp_report_data_income TO ruoyi;



CREATE OR REPLACE FUNCTION proc_jmdemo(pageNo INTEGER, pageSize INTEGER)
    RETURNS SETOF rep_demo_dxtj AS $$
DECLARE
    begin_no INTEGER;
BEGIN
    -- 计算起始偏移量
    begin_no := (pageNo - 1) * pageSize;

    -- 分页查询逻辑
    RETURN QUERY
        SELECT *
        FROM rep_demo_dxtj
        WHERE id >= (
            SELECT id
            FROM rep_demo_dxtj
            ORDER BY id ASC
            LIMIT 1 OFFSET begin_no  -- PostgreSQL 的 OFFSET 语法
        )
        ORDER BY id ASC
        LIMIT pageSize;              -- PostgreSQL 的 LIMIT 语法
END
$$ LANGUAGE plpgsql;
